/*
 * Copyright (c) 2024.  little3201.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *       https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.server.starter.exploiter.bo;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

/**
 * bo class for field.
 *
 * @author wq li
 */
public class FieldBO {

    /**
     * The schema ID to which this field belongs.
     */
    @NotNull
    private Long schemaId;

    /**
     * The name of the field.
     */
    @NotBlank
    private String name;

    /**
     * The column name in the database.
     */
    @NotBlank
    private String columnName;

    /**
     * The data type of the field.
     */
    @NotBlank
    private String dataType;

    /**
     * The length of the field.
     */
    private Integer length;

    /**
     * The type of the field.
     */
    @NotBlank
    private String fieldType;

    /**
     * The form type of the field.
     */
    @NotBlank
    private String formType;

    /**
     * The TypeScript type of the field.
     */
    @NotBlank
    private String tsType;

    /**
     * Indicates whether the field is nullable.
     */
    private boolean nullable;

    /**
     * Indicates whether the field is unique.
     */
    private boolean unique;

    /**
     * Indicates whether the field is queryable.
     */
    private boolean queryable;

    /**
     * Indicates whether the field is editable.
     */
    private boolean editable;

    /**
     * The comment for the field.
     */
    private String comment;

    /**
     * Gets the schema ID to which this field belongs.
     *
     * @return the schema ID
     */
    public Long getSchemaId() {
        return schemaId;
    }

    /**
     * Sets the schema ID to which this field belongs.
     *
     * @param schemaId the schema ID to set
     */
    public void setSchemaId(Long schemaId) {
        this.schemaId = schemaId;
    }

    /**
     * Gets the name of the field.
     *
     * @return the name of the field
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the name of the field.
     *
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Gets the column name in the database.
     *
     * @return the column name
     */
    public String getColumnName() {
        return columnName;
    }

    /**
     * Sets the column name in the database.
     *
     * @param columnName the column name to set
     */
    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    /**
     * Gets the data type of the field.
     *
     * @return the data type
     */
    public String getDataType() {
        return dataType;
    }

    /**
     * Sets the data type of the field.
     *
     * @param dataType the data type to set
     */
    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    /**
     * Gets the length of the field.
     *
     * @return the length
     */
    public Integer getLength() {
        return length;
    }

    /**
     * Sets the length of the field.
     *
     * @param length the length to set
     */
    public void setLength(Integer length) {
        this.length = length;
    }

    /**
     * Gets the type of the field.
     *
     * @return the field type
     */
    public String getFieldType() {
        return fieldType;
    }

    /**
     * Sets the type of the field.
     *
     * @param fieldType the field type to set
     */
    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    /**
     * Gets the form type of the field.
     *
     * @return the form type
     */
    public String getFormType() {
        return formType;
    }

    /**
     * Sets the form type of the field.
     *
     * @param formType the form type to set
     */
    public void setFormType(String formType) {
        this.formType = formType;
    }

    /**
     * Gets the TypeScript type of the field.
     *
     * @return the TypeScript type
     */
    public String getTsType() {
        return tsType;
    }

    /**
     * Sets the TypeScript type of the field.
     *
     * @param tsType the TypeScript type to set
     */
    public void setTsType(String tsType) {
        this.tsType = tsType;
    }

    /**
     * Checks if the field is nullable.
     *
     * @return true if the field is nullable, false otherwise
     */
    public boolean isNullable() {
        return nullable;
    }

    /**
     * Sets whether the field is nullable.
     *
     * @param nullable the nullable status to set
     */
    public void setNullable(boolean nullable) {
        this.nullable = nullable;
    }

    /**
     * Checks if the field is unique.
     *
     * @return true if the field is unique, false otherwise
     */
    public boolean isUnique() {
        return unique;
    }

    /**
     * Sets whether the field is unique.
     *
     * @param unique the unique status to set
     */
    public void setUnique(boolean unique) {
        this.unique = unique;
    }

    /**
     * Checks if the field is queryable.
     *
     * @return true if the field is queryable, false otherwise
     */
    public boolean isQueryable() {
        return queryable;
    }

    /**
     * Sets whether the field is queryable.
     *
     * @param queryable the queryable status to set
     */
    public void setQueryable(boolean queryable) {
        this.queryable = queryable;
    }

    /**
     * Checks if the field is editable.
     *
     * @return true if the field is editable, false otherwise
     */
    public boolean isEditable() {
        return editable;
    }

    /**
     * Sets whether the field is editable.
     *
     * @param editable the editable status to set
     */
    public void setEditable(boolean editable) {
        this.editable = editable;
    }

    /**
     * Gets the comment for the field.
     *
     * @return the comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * Sets the comment for the field.
     *
     * @param comment the comment to set
     */
    public void setComment(String comment) {
        this.comment = comment;
    }


}
